/*
* @Author: dengjiayao
* @Date:   2017-04-18 14:12:16
* @Last Modified by:   dengjiayao
* @Last Modified time: 2017-04-27 18:56:52
*/

import Vue from '../vue'
import store from '../vuex/store'
import loginCheck from '../util/login-check'
import { alert } from 'vue-strap'

import GuideList from './guide-list/guide-list.vue'
import GuideConfig from './guide-config/guide-config.vue'

new Vue({
  el: 'body',
  components: {
    'vue-alert-msg': alert,
    'vue-guide-list': GuideList,
    'vue-guide-config': GuideConfig
  },
  store,
  created() {
    loginCheck(this)
  },
  vuex: {
    getters: {
      msg: state => state.msg
    }
  },
  methods: {
    newGuide(type) {
      var modal = this.$refs.guideConfig
      modal.actionType = 'CREATE'
      modal.form = {
        type: type,
        word: '',
        questionIds: ''
      }
      modal.showModal = true
    }
  }
})
